import Vue from 'vue'
import utils from '@/plugins/utils'
import '@/plugins/http'

import EvanForm from './components/evan-form/evan-form.vue'
import EvanFormItem from './components/evan-form-item/evan-form-item.vue'
import CuBar from './components/_app/cu-bar/index'

import App from './App'

import moment from 'moment'
import store from './store/index'

Vue.component('cu-bar', CuBar)
Vue.component('evan-form', EvanForm)
Vue.component('evan-form-item', EvanFormItem)

Vue.config.productionTip = false
Vue.prototype.$moment = moment
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$store = store

App.mpType = 'app'

const launch = () => {
  const app = new Vue({
    store,
    ...App
  })

  app.$mount()
}

store.dispatch('session/getUserInfo')
  .then(() => {
    launch()
	})